<?php
namespace Admin\Controller;
use Think\Controller;
class CommentController extends BaseController {
    public function index(){
    	echo 'Hello Admin'; 
    }
    public function commentlist(){
    	//调用模型层获取数据
    $commentmodel=M('comments');
    $comment=$commentmodel->order('id asc')->select();
    //调用试图层显示数据
      $this->comment=$comment;
       $this->display();
    }

     public function delcomments($id){
        $commentmodel=M('comments');
        if(false!==$commentmodel->where("id=$id")->delete()){
            $this->success('删除成功!');
        }else{
            $this->error('删除失败!');
        }
    }
      


}